<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>
<body>
    <div id="app">
        <my-slot>
            <!-- 如果此处有内容,子组件中的slot默认内容将不会显示 -->
        </my-slot>
    </div>
    <script>
        Vue.component("my-slot",{
            template:`
            <div>
                <p>组件插槽</p>
                <slot>默认内容</slot>
                <p>组件插槽</p> 
            </div>         
            `
        });
        var app =new Vue({
            el:"#app",
            
        })
    </script>
</body>
</html>